package com.sram.service;

import com.sram.controller.common.base.BaseMapper;
import com.sram.controller.common.base.BaseService;
import com.sram.dao.UserMapper;
import com.sram.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/2/17.
 */
@Service("userService")
public class UserService extends BaseService<User,Integer> {
    @Resource
    private UserMapper userMapper;
    @Autowired
    public void setBaseMapper() {
        super.setBaseMapper(userMapper);
    }
    @Transactional
    public  List<User> getAll () throws Exception {
        List<User> ss = userMapper.getAll();
        return ss;
    }
    @Transactional
    public List<User> getUserByName(String userName, String password) {
        List<User> ss = userMapper.getUserByName(userName,password);
        return ss;
    }
    @Transactional
    public List<User> getUserOneByName(String userName) {
        List<User> ss = userMapper.getUserOneByName(userName);
        return ss;
    }
}
